﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;

namespace Biomedica.Nui.ui
{
    public class WindowTransitions
    {
        public static void AnimateSlideVericalFrameworkElement(Window elem,int From, int To,int time,EventHandler ev)
        {
            DoubleAnimation d = new DoubleAnimation(From,To,new Duration(TimeSpan.FromMilliseconds(time)));
            d.Completed += ev;
            elem.BeginAnimation(Window.HeightProperty, d);
        }

        public static void AnimateSlideHorizentalFrameworkElement(FrameworkElement elem, int From, int To, int time, EventHandler ev)
        {
             DoubleAnimation d;
          
           d = new DoubleAnimation(From, To, new Duration(TimeSpan.FromMilliseconds(time)));
         
         
            d.Completed += ev;            
            elem.BeginAnimation(Window.LeftProperty, d);
        }

        public static void AnimateScaleInOutFrameworkElement(FrameworkElement elem, int From, int To, int time, EventHandler ev)
        {
            DoubleAnimation d;

            d = new DoubleAnimation(From, To, new Duration(TimeSpan.FromMilliseconds(time)));


            d.Completed += ev;
            elem.BeginAnimation(Window.WidthProperty, d);
            elem.BeginAnimation(Window.HeightProperty, d);
        }
      
       
    }
}
